package com.zy.design.pattern.single;

/**
 * @author zhaoyi
 * @date 2021/3/29 15:41
 * 单例模式 - 饿汉式 - 最简单的
 */
public class SimpleSingle {

    private static final SimpleSingle INSTANCE = new SimpleSingle();

    private SimpleSingle(){
        System.out.println("##单例对象 SimpleSingle 被创建了");
    }

    public static SimpleSingle getInstance() {
        return INSTANCE;
    }

    public void sayHello() {
        System.out.println(Thread.currentThread().getName() + " hello " + this);
    }

}
